<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<div class="aui-header-2 aui-gutter-column-md">
    <h2>{{'common_basic_info_label' | i18n}}</h2>
</div>
<ng-container *ngIf="isVm; else elseTemplate">
    <resoure-base-info [source]="source" [sourceType]="sourceType"></resoure-base-info>
    <div class="mgt-20">
        <h2 class="aui-gutter-column-md">{{'common_disk_label' | i18n}}</h2>
        <lv-pro-table #dataTable [config]="tableConfig" [data]="tableData"></lv-pro-table>
    </div>
</ng-container>
<ng-template #elseTemplate>
    <aui-special-base-info [source]="source" [sourceType]="sourceType"></aui-special-base-info>
    <div class="mgt-20">
        <ng-container *ngIf="sourceType === dataMap.Resource_Type.nutanixHost.value; else elseHostTemplate">
            <h2 class="aui-gutter-column-md">{{'common_virtual_machine_label' | i18n}}</h2>
            <aui-vir-base-table [subType]="dataMap.Resource_Type.nutanixVm.value" [treeSelection]="source"
                [isSummary]="true">
            </aui-vir-base-table>
        </ng-container>
        <ng-template #elseHostTemplate>
            <lv-tabs [(lvActiveIndex)]="activeIndex">
                <ng-container *ngFor="let tab of tabs">
                    <lv-tab lvTitle='{{tab.label}}' [lvId]="tab.id" *ngIf="!tab.hide">
                        <aui-vir-base-table [subType]="tab.subType" [treeSelection]="source" [isSummary]="true">
                        </aui-vir-base-table>
                    </lv-tab>
                </ng-container>
            </lv-tabs>
        </ng-template>
    </div>
</ng-template>

<ng-template #sizeTpl let-item>
    <span lv-overflow>{{item.size | capacityCalculateLabel:'1.0-0':unitconst.BYTE:false}}</span>
</ng-template>

<ng-template #headerTpl>
    <aui-custom-modal-operate [item]="item"></aui-custom-modal-operate>
</ng-template>
